<?php
/**
 * Created by PhpStorm.
 * User: Duyonggao
 * Date: 2017/8/7 0007
 * Time: 上午 11:35
 * @var $this yii\web\View
 */
use app\assets\AppAsset;
use utils\HelperSearch;
use yii\helpers\Url;

AppAsset::register($this);
$this->title = "郁姐网";
$path = Url::to(['search/coupon']);
$js = <<<JS
$(".quan_check").each(function(){
    var ths = $(this),gid = ths.data("gid"),aid = ths.data("aid");
    $.get("{$path}",{aid:aid,gid:gid},function(data){
        if(data.status != 200 || typeof data.data.code != 'undefined'){
            ths.hide();
        }
    });
});
JS;
$this->registerJs($js);
?>
<?php $this->beginBlock('keyword'); ?>
<meta name="Keywords" content="郁姐网,淘商品,淘好货,淘宝好商品,代购,担保购买,优惠券,代金券,优惠券网,网购优惠券,电子优惠券,内部优惠券,淘宝,天猫,京东,苏宁,唯品会,聚美优品,网易,灵山优惠券,钦州优惠券,平南优惠券"/>
<meta name="Description" content="郁姐优惠券网免费领取肯德基KFC、麦当劳、淘宝天猫、唯品会、聚美优品、京东、好乐买、汉堡王、必胜客、德克士、苏宁、网易、当当网、一号店等电子购物优惠券。还有更多代金券、红包、优惠券怎么领取和使用、设置等方法攻略！"/>
<meta name="location" content="province=广西;city=钦州;coord=108.63879805642,21.973350465313">
<?php $this->endBlock(); ?>
<form class="form-inline" id="search_form" method="get" action="<?=\yii\helpers\Url::to(['search/list'],true)?>">
    <div class="input-group  col-lg-10">
        <input type="text" value="<?=Yii::$app->request->get("key_word")?>" class="form-control" name="key_word" id="title_search" placeholder="请输入要搜索的内容或品牌">
          <span class="input-group-btn">
            <button type="submit" class="btn btn-default" type="button">搜一下 Go!</button>
          </span>
    </div>
</form>
<br/>
<div class="btn-group" role="group">
    <?php foreach($list as $k => $vo){ ?>
        <a href="<?=\yii\helpers\Url::to(['search/list','key_word'=>$vo['word']],true)?>" class="btn btn-default"><?=$vo['word']?></a>
    <?php } ?>
</div>
<br/>
<br/>
<div class="btn-group" role="group">
    <?php foreach(HelperSearch::$couponMap as $k => $vo){ ?>
        <a href="<?=\yii\helpers\Url::to(['search/index','cat'=>$k],true)?>" class="btn btn-default"><?=$vo?></a>
    <?php } ?>
</div>

<?=$this->render("//layouts/show_list",['list'=>$data_list]);?>
<div id="pager">
    <?=$pager?>
</div>

